<template>
  <div class="home">
    <div class="nav">
      <ul>
        <li @click="toChildPage('index')">首页</li>
        <li @click="toChildPage('user')">用户管理</li>
        <li @click="toChildPage('shop')">商品管理</li>
        <li @click="toChildPage('order')">订单管理</li>
        <li @click="toChildPage('logistics')">物流管理</li>
      </ul>
    </div>
    <div class="main">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>

export default {
  name: 'HomeView',
  methods:{
    toChildPage(path){
      if(path == "order"){
        this.$router.push({
          path:"/home/" + path + "/aaa",
          // name:"home_order",
          // params:{
          //   name:"张三",
          //   age:18
          // },
          // query:{
          //   name:"张三",
          //   age:18
          // }
        })
      }else{
        this.$router.push("/home/" + path)
      }
      
    }
  }
}
</script>
<style scoped>
  .home{
    width: 100vw;
    height: 100vh;
    /* overflow: hidden; */
    display: flex;
  }
  .nav{
    width: 150px;
    height: 100vh;
    background: #f00;
  }
  .main{
    flex: 1;
    height: 100vh;
    background: #00f;
  }
  li{
    list-style: none;
    text-align: center;
    line-height: 50px;
    font-weight: bold;
    font-size: 20px;
    color: #fff;
    cursor: pointer;
  }
</style>
